package com.example;

import com.example.bat.BatController;
import com.example.dao.BatDao;
import com.example.pojo.BatPojoUser;
import com.example.readis.RedisController;
import com.example.template.Template;
import com.example.utils.BatUtils;
import org.apache.ibatis.session.SqlSession;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.cache.CacheProperties;
import org.springframework.boot.autoconfigure.data.redis.RedisProperties;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

import java.util.ArrayList;
import java.util.List;

@EnableCaching
@SpringBootApplication
public class MySpringDemoApplication {
    public static List<BatPojoUser> get_data(int count){
        ArrayList<BatPojoUser> list_data = new ArrayList<>();
        for (int i = 0;i< count; i++){
            BatPojoUser user = new BatPojoUser();
            user.setName("小红"+i+1);
            user.setPwd("qazwsx"+i);
            list_data.add(user);
        }
        return list_data;
    }
//    @Bean
//    public RestTemplate getTemplate(){
//        return new RestTemplate();
//    }
    public static void main(String[] args) {
        SpringApplication.run(MySpringDemoApplication.class, args);
    }
    @Bean
    public Template getTemplate(){
        System.out.println("Template alloc init");
        return new Template();
    }
}
